package com.ct.event.service;

import com.ct.event.AsyncSendEmailEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class SendMessageListener implements ApplicationListener<AsyncSendEmailEvent> {

    @Override
    @Async
    public void onApplicationEvent(AsyncSendEmailEvent event) {
        log.info("发送短信的操作，发送的用户是：{}", event.getUserId());
    }
}